package com.service;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.beans.StudentInfo;
import com.mapper.StudentMapper;
@Service @Transactional
public class StudentServiceImpl implements StudentService {

	@Resource
	StudentMapper studentMapper;
	
	//查询所有
	public List<StudentInfo> findAll() {
		return studentMapper.findAll();
	}

	//根据id查询
	public StudentInfo getStuById(Integer id) {
		return studentMapper.getStuById(id);
	}

	//更新
	public void updateStu(StudentInfo stu) {
		studentMapper.updateStu(stu);
	}

	//删除
	public void deleteStuById(Integer id) {
		studentMapper.deleteStuById(id);
	}

	//添加
	public void addStudent(StudentInfo student) {
		studentMapper.addStudent(student);
	}

}
